package com.zy.userapp.service;

import com.zy.userapp.domain.TCoupon;
import com.zy.userapp.domain.TCouponExample;
import com.zy.userapp.mapper.TCouponMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CouponService {

    @Autowired
    private TCouponMapper tCouponMapper;

    public void print(){
        System.err.println("enter coupon service");
    }


    public String query(){
        TCouponExample example = new TCouponExample();
        example.createCriteria().andCodeEqualTo("fd3eac2c-e0c8-44ed-9493-4eedbc3f0410");
        List<TCoupon> tCoupon =  tCouponMapper.selectByExample(example);
        return tCoupon.get(0).toString();
    }
}
